<template>
    <el-table class='table-child' :data="tableChild" :show-header='false' v-loading="loadingChild" style="width: 100%;padding:0;" >
        <el-table-column width="49">
            <template scope="scope">
                <span></span> 
            </template>
        </el-table-column>
        <el-table-column label="">
            <template scope="scope">
                <span></span>
            </template>
        </el-table-column>
        <el-table-column label="">
            <template scope="scope">
                <span></span>
            </template>
        </el-table-column>
        <el-table-column label="商品名称">
            <template scope="scope">
                <span>{{scope.row.sIncrementName | isNull}}</span>
            </template>
        </el-table-column>
        <el-table-column label="订单总量（条）">
            <template scope="scope">
                <span>{{scope.row.totalNum | isNull}} （会员打包订单量：{{scope.row.vipTotalNum?scope.row.vipTotalNum:'0'}}）</span>
            </template>
        </el-table-column>
        <el-table-column label="总销售额（元）">
            <template scope="scope">
                <span>{{scope.row.totalMoney | isNull}} （会员打包订单销售额：{{scope.row.vipTotalMoney | isNull}}）</span>
            </template>
        </el-table-column>
    </el-table>  
</template>
<script>
    import { getSchoolStatistics } from 'api/serviceManage';
    export default {
        name: 'childSchoolTable',
        props: {
            scope: Object,  // $index/row/store  你可以看scope 这个对象，这个页面有很多简化的 
            childData: Object
        },
        data() {
            return { 
                loadingChild: false,
                tableChild: []
            }
        },
        mounted() {
            // scope.row 可以获取这个row的信息比如id什么的,
            // 异步获取数据 赋值给 resourceC 即可

            let fSchoolId = this.scope.row.fSchoolId; // 学校id
            let date = this.childData.date;// 查询的月份，如2017-10
            this.loadingChild = true;
            getSchoolStatistics(fSchoolId, date).then(res => {
                this.loadingChild = false;
                this.tableChild = res.data.content;
            }).catch(() => {
                this.loadingChild = false;
            });
        }
    }

</script>


